package com.yuncheng.oaApi.OaExcel.Controller;


import com.yuncheng.oaApi.OaExcel.Utils.OaFillExcel;
import com.yuncheng.oaApi.constant.OaCommonFlowConstant;
import com.yuncheng.oaApi.service.INkYssbhjService;
import com.yuncheng.oaApi.service.INkYssbhjjxzbService;
import io.swagger.annotations.Api;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;





@Api(tags = "excel模板导出")
@RestController
@RequestMapping("/api/spzx-oa/exceldc")
public class OaExcelController {

    @Resource
    @Lazy
    private INkYssbhjService nkYssbhjService;

    @Resource
    private INkYssbhjjxzbService nkYssbhjjxzbService;


    @Resource
    private OaFillExcel oaFillExcel;


    @GetMapping( "/generateExcellwcl")
    public void generateExcelForm(HttpServletResponse response,String jhid,String flx) {
        String fsblx = OaCommonFlowConstant.HZLX_JC;
        oaFillExcel.listFilljc(response,jhid,flx,fsblx);


    }

    @GetMapping( "/generateExcelkt")
    public void generateExcelFormkt(HttpServletResponse response,String jhid,String flx) {
        String fsblx = OaCommonFlowConstant.HZLX_KT;
        oaFillExcel.listFilljc(response,jhid,flx,fsblx);


    }


    @GetMapping( "/generateExcelys")
    public void generateExcelFormys(HttpServletResponse response,String jhid,String flx)  {
        String fsblx = OaCommonFlowConstant.HZLX_YS;
        oaFillExcel.listFilljc(response,jhid,flx,fsblx);


    }

    @GetMapping( "/generateExcelpx")
    public void generateExcelFormpx(HttpServletResponse response,String jhid,String flx)  {
        String fsblx = OaCommonFlowConstant.HZLX_PX;
        oaFillExcel.listFilljc(response,jhid,flx,fsblx);
    }


    /**
     * 预算申报 多选或者全部导出
     * @param response
     * @param jhid
     * @param flx
     */
    @GetMapping( "/generateExcelall")
    public void generateExcelall(HttpServletResponse response,String jhid,String flx)  {
        String fsblx = OaCommonFlowConstant.HZLX_PX;
        oaFillExcel.listFilljc(response,jhid,flx,fsblx);
    }


    /**
     *  绩效导出

     * @param response
     */
    @GetMapping(value = "/exportRealTimeJxzb", name = "绩效导出")
    public void exportRealTimeInventory(HttpServletResponse response,String jhid,String flx) {
        nkYssbhjjxzbService.exportRealTimeInventory(response,jhid,flx);
    }



}
